package com.atguigu.gmall.web.controller;

import com.atguigu.gmall.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author atguigu-mqx
 * @Description TODO
 * @Date 2023/7/21 10:28
 * @Version 1.0
 */
@Controller
public class PassportController {

    //  http://passport.gmall.com/login.html?originUrl=http://www.gmall.com/
    //  originUrl: [[${originUrl}]] 作用记录当前用户从哪里点击的登录.登录成功之后，再跳回去！

    /**
     * 登录页面
     * @param request
     * @return
     */
    @GetMapping("login.html")
    public String login(HttpServletRequest request){
        //  originUrl: [[${originUrl}]]
        request.setAttribute("originUrl",request.getParameter("originUrl"));
        //  返回登录页面.
        return "login";
    }




}
